var AutoSave = {
	saveReq:null,
	save: function(content, url, callbackFunc){
		if (content!==null && url!==null) {		
			var param = "&content="+content;
			saveReq = httpRequest("post",url,true,callbackFunc,param);
		}
	},
};

var replyEle = document.getElementById("myReply");
var params = makeParams(["reply_ID", "threads_ID", "reply_content"]);

callback = function(){
	if(saveReq.readyState == 4){
		if(saveReq.status == 200){
			console.log(saveReq.responseText);
			var jsonStr = saveReq.responseText;
			var obj = JSON.parse(jsonStr);
			
			document.getElementsByName("replyID")[0].value = obj.replyID;
		}
	}
};
var saveFunc = AutoSave.save("reply/autoSave.do", callback, replyObj);

document.getElementByID("myReply").onfocus = function(){
	window.setInterval(saveFunc, 2000);
};